<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>充值记录</title>
<link rel="stylesheet" href="/layui/css/layui.css">
<script src="/static/js/jquery.min.js"></script>
<script src="/layui/layui.js"></script>
<style>body{background:#f5f5f5;padding:20px;}</style>
</head>
<body>
<div class="layui-card"><div class="layui-card-header">充值记录</div><div class="layui-card-body">
<div class="layui-form layui-form-pane" style="margin-bottom:15px;"><div class="layui-inline"><input type="text" id="username" placeholder="用户账号" class="layui-input" value="<?= htmlspecialchars($username) ?>"></div><button class="layui-btn layui-btn-primary layui-btn-sm" onclick="search()">搜索</button></div>
<table class="layui-table" lay-size="sm"><thead><tr><th>ID</th><th>用户</th><th>金额</th><th>类型</th><th>操作人</th><th>备注</th><th>时间</th></tr></thead>
<tbody><?php foreach($list as $item): ?><tr><td><?= $item['id'] ?></td><td><?= $item['username'] ?></td><td>¥<?= number_format($item['amount'],2) ?></td><td><?= $item['type']=='manual'?'手动充值':'消费充值' ?></td><td><?= $item['operator_name'] ?></td><td><?= htmlspecialchars($item['remark'] ?: '-') ?></td><td><?= $item['create_time'] ?></td></tr><?php endforeach; ?><?php if(empty($list)):?><tr><td colspan="7" style="text-align:center;color:#999;">暂无数据</td></tr><?php endif;?></tbody></table>
<div id="page"></div></div></div>
<script>
var total=<?=$total?>,page=<?=$page?>,pageSize=<?=$pageSize?>;
layui.use('laypage',function(){var p=layui.laypage;if(total>pageSize){p.render({elem:'page',count:total,limit:pageSize,curr:page,jump:function(o,f){if(!f) location.href='/admin/user/rechargeList?page='+o.curr+'&username=<?=urlencode($username)?>';}});}});
function search(){location.href='/admin/user/rechargeList?username='+encodeURIComponent($('#username').val());}
</script>
</body>
</html>